package com.taxi.driver.data.config;

import com.taxi.driver.data.config.local.ConfigLocalSource;
import com.taxi.driver.data.config.remote.ConfigRemoteSource;
import com.taxi.driver.data.entity.ConfigEntity;
import com.taxi.driver.data.entity.GovernEntity;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Singleton;

import rx.Observable;

@Singleton
public class ConfigRepository implements ConfigSource {

    private final ConfigLocalSource mConfigLocalSource;
    private final ConfigRemoteSource mConfigRemoteSource;

    @Inject
    public ConfigRepository(ConfigLocalSource localSource,
                            ConfigRemoteSource remoteSource) {
        mConfigLocalSource = localSource;
        mConfigRemoteSource = remoteSource;
    }

    @Override
    public Observable<List<ConfigEntity>> variable() {
        return mConfigRemoteSource.variable();
    }

    @Override
    public Observable<GovernEntity> getGovern() {
        return mConfigRemoteSource.getGovern();
    }

    @Override
    public void saveAbout(String value) {
        mConfigLocalSource.saveAbout(value);
    }

    @Override
    public String getAbout() {
        return mConfigLocalSource.getAbout();
    }

    @Override
    public void savePriceRules(String value) {
        mConfigLocalSource.savePriceRules(value);
    }

    @Override
    public String getPriceRules() {
        return mConfigLocalSource.getPriceRules();
    }

    @Override
    public void saveRuleExplain(String value) {
        mConfigLocalSource.saveRuleExplain(value);
    }

    @Override
    public String getRuleExplain() {
        return mConfigLocalSource.getRuleExplain();
    }

    @Override
    public void saveAgress(String value) {
        mConfigLocalSource.saveAgress(value);
    }

    @Override
    public String getAgress() {
        return mConfigLocalSource.getAgress();
    }

    @Override
    public Observable<String> removePayCache(String orderUuid) {
        return mConfigRemoteSource.removePayCache(orderUuid);
    }

    @Override
    public Observable<String> payCallback(String orderUuid) {
        return mConfigRemoteSource.payCallback(orderUuid);
    }
}
